#include <stdio.h>
#include <stdlib.h>

int main()
{
	int** arr = (int**)malloc(sizeof(int*) * 3);
	arr[0] = (int*)malloc(sizeof(int) * 5);
	arr[1] = (int*)malloc(sizeof(int) * 5);
	arr[2] = (int*)malloc(sizeof(int) * 5);
	int i = 0;
	int j = 0;
	int count = 0;
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 5; j++)
		{
			arr[i][j] = count;
			count++;
		}
	}
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 5; j++)
		{
			printf("%d ", arr[i][j]);
		}
	}
	free(arr[0]);
	free(arr[1]);
	free(arr[2]);
	free(arr);


	return 0;
}